import dict from '@/const/dict/dict';

export default {
  height: 'auto',
  calcHeight: 30,
  tip: false,
  searchShow: true,
  border: true,
  index: true,
  viewBtn: true,
  selection: true,
  dialogClickModal: false,
  grid: false,
  gridBtn: false,
  dialogDrag: true,
  labelWidth: 140,
  defaultSort: {
    prop: 'createTime',
    order: 'ascending'
  },
  column: [
    {
      label: '主键',
      prop: 'id',
      type: 'input',
      addDisplay: false,
      editDisplay: false,
      viewDisplay: false,
      hide: true
    },
    {
      label: '服务平台',
      prop: 'service',
      type: 'input',
      search: true,
      searchSpan: 6,
      searchLabelWidth: 100,
      rules: [{
        required: true,
        message: '请选择服务平台',
        trigger: 'blur'
      }]
    },
    {
      label: '网站',
      prop: 'website',
      type: 'input',
      showOverflowTooltip: true
    },
    {
      label: '余额API',
      prop: 'balanceApi',
      component: 'code-editor',
      row: true,
      span: 24,
      hide: true,
    },
    {
      label: '国家API',
      prop: 'countryApi',
      component: 'code-editor',
      row: true,
      span: 24,
      hide: true,
    },
    {
      label: '运营商API',
      prop: 'operatorApi',
      component: 'code-editor',
      row: true,
      span: 24,
      hide: true,
    },
    {
      label: '价格API',
      prop: 'priceApi',
      component: 'code-editor',
      row: true,
      span: 24,
      hide: true,
    },
    {
      label: '取号API',
      prop: 'phoneApi',
      component: 'code-editor',
      row: true,
      span: 24,
      hide: true,
    },
    {
      label: '验证码API',
      prop: 'codeApi',
      component: 'code-editor',
      row: true,
      span: 24,
      hide: true,
    },
    {
      label: '状态API',
      prop: 'statusApi',
      component: 'code-editor',
      row: true,
      span: 24,
      hide: true,
    },
    {
      label: 'TOP-API',
      prop: 'topApi',
      component: 'code-editor',
      row: true,
      span: 24,
      hide: true,
    },
    {
      label: '对外开放',
      prop: 'isOpen',
      type: 'switch',
      dicData: dict.yes_no,
      dataType: 'number',
      value: 2,
      search: true,
      searchSpan: 4,
      searchLabelWidth: 100,
      rules: [{
        required: true,
        message: '请选择对外开放',
        trigger: 'blur'
      }]
    },
    {
      label: '同步价格禁用',
      labelTip: '是否禁用同步价格API',
      prop: 'syncPrice',
      type: 'switch',
      dicData: dict.yes_no,
      dataType: 'number',
      value: 2,
      rules: [{
        required: true,
        message: '请选择同步价格',
        trigger: 'blur'
      }]
    },
    {
      label: '通知完成',
      labelTip: '收到验证码是否通知平台已完成',
      prop: 'isComplete',
      type: 'switch',
      dicData: dict.yes_no,
      dataType: 'number',
      rules: [{
        required: true,
        message: '请选择是否通知完成',
        trigger: 'blur'
      }],
      value: 2,
      hide: true
    },
    {
      label: '通知取消',
      labelTip: '发送失败/接收验证码超时是否通知平台取消',
      prop: 'isCancel',
      type: 'switch',
      dicData: dict.yes_no,
      dataType: 'number',
      rules: [{
        required: true,
        message: '请选择是否通知取消',
        trigger: 'blur'
      }],
      value: 2,
      hide: true
    },
    {
      label: '延迟时间',
      labelTip: '多少秒后通知平台取消号码',
      prop: 'cancelDelayTime',
      type: 'number',
      controls: false,
      hide: true
    },
    {
      label: '等待时长',
      labelTip: '验证码等待时长(分钟)',
      prop: 'codeWaitTime',
      type: 'number',
      controls: false,
      value: 6,
      rules: [{
        required: true,
        message: '请输入验证码等待时长',
        trigger: 'blur'
      }],
      hide: true
    },
    {
      label: '最大价格禁用',
      labelTip: '任务配置时该选项是否禁用',
      prop: 'isMaxPrice',
      type: 'switch',
      dicData: dict.yes_no,
      dataType: 'number',
      rules: [{
        required: true,
        message: '请选择是否禁用最大价格',
        trigger: 'blur'
      }],
      value: 1,
      hide: true
    },
    {
      label: '号段排除禁用',
      labelTip: '任务配置时该选项是否禁用',
      prop: 'isPhoneException',
      type: 'switch',
      dicData: dict.yes_no,
      dataType: 'number',
      rules: [{
        required: true,
        message: '请选择是否禁用号段排除',
        trigger: 'blur'
      }],
      value: 1,
      hide: true
    },
    {
      label: '运营商多选',
      labelTip: '任务配置时该选项是否只能选择一个',
      prop: 'isOperatorArray',
      type: 'select',
      dicData: dict.yes_no,
      dataType: 'number',
      rules: [{
        required: true,
        message: '请选择是否禁用运营商',
        trigger: 'blur'
      }],
      value: 1,
      hide: true
    },
    {
      label: '创建时间',
      prop: 'createTime',
      type: 'date',
      format: 'YYYY-MM-DD HH:mm:ss',
      valueFormat: 'YYYY-MM-DD HH:mm:ss',
      startPlaceholder: '开始日期',
      endPlaceholder: '结束日期',
      addDisplay: false,
      editDisplay: false,
      viewDisplay: false,
      sortable: 'custom',
      width: 180
    },
    {
      label: '状态',
      prop: 'status',
      type: 'switch',
      dicData: dict.enable_disable,
      dataType: 'number',
      value: 1,
      search: true,
      searchSpan: 4,
      searchLabelWidth: 75,
      rules: [{
        required: true,
        message: '请输入状态',
        trigger: 'blur'
      }]
    }
  ]
};
